home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1996 / MacHack 1996.toast / Hacks / Hacks ’95 / ProcessBar™ / Code / Sources / ProcessesPrivate.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-06-23  |  3.5 KB  |  117 lines  |  [TEXT/MMCC]

  1. /*
  2.     File:        ProcessesPrivate.h
  3.  
  4.     Copyright:    © 1983-1993 by Apple Computer, Inc.
  5.                 All rights reserved.
  6.  
  7.     Version:    System 7.1
  8.     Created:    Thursday, April 28, 1989 18:00
  9.  
  10. */
  11.  
  12. #pragma once
  13.  
  14. #ifndef __PROCESSESPRIVATE__
  15. #define __PROCESSESPRIVATE__
  16.  
  17. #ifndef __TYPES__
  18. #include <Types.h>
  19. /*    #include <ConditionalMacros.h>                                */
  20. /*    #include <MixedMode.h>                                        */
  21. /*        #include <Traps.h>                                        */
  22. #endif
  23.  
  24. #ifndef __PROCESSES__
  25. #include <Processes.h>
  26. /*    #include <Events.h>                                            */
  27. /*        #include <Quickdraw.h>                                    */
  28. /*            #include <QuickdrawText.h>                            */
  29. /*                #include <IntlResources.h>                        */
  30. /*        #include <OSUtils.h>                                    */
  31. /*    #include <Files.h>                                            */
  32. /*        #include <SegLoad.h>                                    */
  33. #endif
  34.  
  35.  
  36. #ifndef __LAYERS__
  37. #include "Layers.h"
  38. /*    #include <Layers.h>                                            */
  39. /*        #include <QuickDraw.h>                                    */
  40. /*            #include <QuickdrawText.h>                            */
  41. /*                #include <IntlResources.h>                        */
  42. #endif
  43.  
  44. typedef struct ProcessStuff ProcessStuff;
  45. typedef ProcessStuff *ProcessStuffPtr, **ProcessStuffHndl;
  46.  
  47. #if defined(powerc) || defined (__powerc)
  48. #pragma options align=mac68k
  49. #endif
  50. struct ProcessStuff {
  51.     long    reserved1[14];
  52.     Str31    processName;
  53.     long    reserved2[34];
  54. };
  55. #if defined(powerc) || defined(__powerc)
  56. #pragma options align=reset
  57. #endif
  58.  
  59. typedef struct ProcessDescriptor ProcessDescriptor;
  60. typedef ProcessDescriptor *ProcessDescriptorPtr;
  61.  
  62. #if defined(powerc) || defined (__powerc)
  63. #pragma options align=mac68k
  64. #endif
  65. struct ProcessDescriptor {
  66.     short                    processState;
  67.     short                    processIdentifier;
  68.     OSType                    processType;            //    type of the "application"
  69.     OSType                    processSignature;        //    signature of the "application"
  70.     long                    reserved1[2];
  71.     ProcessDescriptorPtr    processNext;            //    next ProcessDescriptor (nil terminated)
  72.     long                    reserved2[3];
  73.     ProcessSerialNumber        processNumber;
  74.     long                    reserved3[10];
  75.     ProcessStuffHndl        processStuff;
  76.     long                    reserved4[6];
  77.     LayerPtr                processLayer;
  78.     long                    reserved5[59];
  79.     short                    reserved6;
  80. };
  81. #if defined(powerc) || defined(__powerc)
  82. #pragma options align=reset
  83. #endif
  84.  
  85. extern pascal LayerPtr GetCurrentProcessLayer(void)
  86. THREEWORDINLINE(0x3F3C, 0x0004, 0xA88F);
  87. /* returns the window whose content region contains the point */
  88. extern pascal WindowPtr WhichWindow(Point where)
  89. THREEWORDINLINE(0x3F3C, 0x000F, 0xA88F);
  90. /* returns processIdentifier field for current process or zero if none */
  91. extern pascal short GetCurrentProcessIdentifier(void)
  92. THREEWORDINLINE(0x3F3C, 0x0013, 0xA88F);
  93. /* returns next process layer */
  94. extern pascal LayerPtr GetNextProcessLayer(LayerPtr theLayer, Boolean visible)
  95. THREEWORDINLINE(0x3F3C, 0x002B, 0xA88F);
  96. /* returns first process layer */
  97. #define GetFirstProcessLayer(visible) GetNextProcessLayer(nil, visible)
  98. extern pascal OSErr GetFinderProcess(ProcessSerialNumber *PSN)
  99. THREEWORDINLINE(0x3F3C, 0x0056, 0xA88F);
  100.  
  101. /* ProcessWorld is actually "MultiFinder's" A5 */
  102. #define GetProcessWorld() (* (long *) 0x0B7C)
  103. /* -0x30C is the first ProcessDescriptor */
  104. extern pascal ProcessDescriptorPtr XGetFirstProcessDescriptor(void)
  105. FOURWORDINLINE(0x2078, 0x0B7C, 0x2EA8, 0xFCF4);
  106. /* -0x330 is the current ProcessDescriptor */
  107. extern pascal ProcessDescriptorPtr XGetCurrentProcessDescriptor(void)
  108. FOURWORDINLINE(0x2078, 0x0B7C, 0x2EA8, 0xFCD0);
  109. /* -0x356 is the "MultiFinder" layer */
  110. extern pascal LayerPtr XGetMFRootLayer(void)
  111. FOURWORDINLINE(0x2078, 0x0B7C, 0x2EA8, 0xFCAA);
  112. /* _0x362 is the Finder ProcessDesciptor */
  113. extern pascal ProcessDescriptorPtr XGetFinderProcessDescriptor(void)
  114. FOURWORDINLINE(0x2078, 0x0B7C, 0x2EA8, 0xFC9E);
  115.  
  116. #endif
  117.